//
//  LMBaseCollectionView.h
//  LMLabelSelect
//
//  Created by LM on 2022/11/30.
//

#import <UIKit/UIKit.h>

typedef NSInteger (^NumberOfSectionsInCollectionViewBlock)(UICollectionView *collectionView);

typedef UICollectionViewCell* (^CellForItemsAtIndexPathBlock)(UICollectionView *collectionView, NSIndexPath *indexPath);

typedef NSInteger (^NumberOfItemsInSectionBlock)(UICollectionView *collectionView, NSInteger section);

typedef UICollectionReusableView* (^ViewForSupplementaryElementBlock)(UICollectionView *collectionView, NSString *kind, NSIndexPath *indexPath);

typedef CGSize (^SizeForItemAtIndexPath)(UICollectionView *collectionView, UICollectionViewLayout *collectionViewLayout, NSIndexPath *indexPath);

typedef UIEdgeInsets (^InsetForSectionAtIndex)(UICollectionView *collectionView, UICollectionViewLayout *collectionViewLayout, NSInteger section);

typedef CGFloat (^MinimumLineSpacingForSectionAtIndex)(UICollectionView *collectionView, UICollectionViewLayout *collectionViewLayout, NSInteger section);

typedef CGFloat (^MinimumInteritemSpacingForSectionAtIndex)(UICollectionView *collectionView, UICollectionViewLayout *collectionViewLayout, NSInteger section);

typedef CGSize (^ReferenceSizeForHeaderInSection)(UICollectionView *collectionView, UICollectionViewLayout *collectionViewLayout, NSInteger section);

typedef CGSize (^ReferenceSizeForFooterInSection)(UICollectionView *collectionView, UICollectionViewLayout *collectionViewLayout, NSInteger section);

typedef void (^DidSelectItemAtIndexPath)(UICollectionView *collectionView, NSIndexPath *indexPath);

typedef void (^DidDeselectItemAtIndexPath)(UICollectionView *collectionView, NSIndexPath *indexPath);
typedef void (^ScrollViewDidScroll)(UIScrollView *scrollView);

typedef void (^ScrollViewDidEndDecelerating)(UIScrollView *scrollView);

typedef void (^ScrollViewWillBeginDecelerating)(UIScrollView *scrollView);
typedef void (^ScrollViewWillBeginDragging)(UIScrollView *scrollView);

typedef void (^ScrollViewDidEndDragging)(UIScrollView *scrollView, BOOL decelerate);

NS_ASSUME_NONNULL_BEGIN

@interface LMBaseCollectionView : UICollectionView<UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,UICollectionViewDelegateFlowLayout>
@property (nonatomic, copy) NumberOfSectionsInCollectionViewBlock numberOfSectionsBlock;
@property (nonatomic, copy) CellForItemsAtIndexPathBlock cellForItemsBlock;
@property (nonatomic, copy) NumberOfItemsInSectionBlock numberOfItemsBlock;
@property (nonatomic, copy) ViewForSupplementaryElementBlock viewForSupplementaryElementBlock;
@property (nonatomic, copy) SizeForItemAtIndexPath sizeForItemBlock;
@property (nonatomic, copy) InsetForSectionAtIndex insetForSectionBlock;
@property (nonatomic, copy) MinimumLineSpacingForSectionAtIndex minimulineSpacingBlock;
@property (nonatomic, copy) MinimumInteritemSpacingForSectionAtIndex minimumInterItemSpacingBlock;
@property (nonatomic, copy) ReferenceSizeForHeaderInSection refernceSizeForHeaderBlock;
@property (nonatomic, copy) ReferenceSizeForFooterInSection refernceSizeForFooterBlock;
@property (nonatomic, copy) DidSelectItemAtIndexPath didSelectItemBlock;
@property (nonatomic, copy) DidDeselectItemAtIndexPath didDeselectItemBlock;
@property (nonatomic, copy) ScrollViewDidScroll scrollViewDidScroll;
@property (nonatomic, copy) ScrollViewDidEndDecelerating scrollViewDidEndDecelerating;
@property (nonatomic, copy) ScrollViewWillBeginDecelerating scrollViewWillBeginDecelerating;
@property (nonatomic, copy) ScrollViewDidEndDragging scrollViewDidEndDragging;
@property (nonatomic, copy) ScrollViewWillBeginDragging scrollViewWillBeginDragging;

@property (nonatomic, strong) UICollectionViewFlowLayout *flowLayout;
@end

NS_ASSUME_NONNULL_END
